package net.heri.xmppchat;

import net.heri.xmppchat.persistence.IXmppChatDBHelper;
import net.heri.xmppchat.persistence.XmppChatDBHelper;

import com.google.inject.AbstractModule;
import com.google.inject.Stage;

import roboguice.RoboGuice;
import android.app.Application;

public class App extends Application {
	@Override
	public void onCreate() {	
		super.onCreate();
		
		RoboGuice.setBaseApplicationInjector(
				this, 
				Stage.DEVELOPMENT,
				RoboGuice.newDefaultRoboModule(this),
				new ChatModule());
	}
	
	private class ChatModule extends AbstractModule {
		@Override
		protected void configure() {
			
			// Persistence
			bind(IXmppChatDBHelper.class).toInstance(new XmppChatDBHelper(App.this));
		}		
	}
	
}
